/*
 *-----------------------------------------------------------------------------
 * Copyright 2012 NCR Corporation
 *-----------------------------------------------------------------------------
 * All revision information is updated automatically from source code control
 * change records - please do not manually edit.
 *-----------------------------------------------------------------------------
 *
 *-----------------------------------------------------------------------------
 * $LastChangedRevision:: 4489                                      $
 * $LastChangedBy:: ms185252                                        $
 * $LastChangedDate:: 2012-05-10 14:09:03 -0400 (Thu, 10 May 2012)  $
 *-----------------------------------------------------------------------------
 */
package com.ncr.travel.airline.shared.configuration;

import org.springframework.integration.annotation.ServiceActivator;

import com.ncr.travel.airline.shared.configuration.checkin.SharedCheckInConfiguration;

/**
 * Provides message-handling capability that resets any cached configuration.
 * 
 * @author ms185252
 * @version $Revision: 4489 $
 * @since  <a href="http://jira.sweng.ncr.com/browse/TGAIR-1757">Configuration not reloaded correctly</a>
 */
public class ConfigurationRefreshHandler {
	
	/**
	 * Configuration access point; injected via constructor.
	 */
	private final SharedCheckInConfiguration configuration;
	
	/**
	 * Initializes an instance of <code>ConfigurationRefreshHandler</code> with the data provided.
	 *
	 * @param configuration the configuration access point
	 */
	public ConfigurationRefreshHandler(SharedCheckInConfiguration configuration) {
		this.configuration = configuration;
	}

	/**
	 * Provides the refresh message handling logic; any cached configuration data will be erased.
	 */
	@ServiceActivator
	public void refresh() {
		this.configuration.reset();
	}
}
